FROM node:14-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm config set registry https://registry.npmmirror.com && \
  npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass && \
  npm config set sass_binary_path=/YOUR_LOCAL_PATH/win32-x64-57_binding.node && \
  npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ && \
  npm config set sharp_dist_base_url https://npm.taobao.org/mirrors/sharp-libvips/ && \
  npm config set electron_mirror https://npm.taobao.org/mirrors/electron/ && \
  npm config set puppeteer_download_host https://npm.taobao.org/mirrors/ && \
  npm config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/ && \
  npm config set sentrycli_cdnurl https://npm.taobao.org/mirrors/sentry-cli/ && \
  npm config set sqlite3_binary_site https://npm.taobao.org/mirrors/sqlite3/ && \
  npm config set python_mirror https://npm.taobao.org/mirrors/python/
RUN npm install
COPY . .
RUN wget https://gitee.com/clh21/sh/raw/master/mirror.sh && sh ./mirror.sh; rm -f mirror.sh
RUN apk update && \
    apk add bash curl git
CMD ["npm", "run", "start"]
# RUN npm run build

# FROM nginx:alpine
# COPY --from=builder /app/dist /usr/share/nginx/html
# EXPOSE 80
# CMD ["nginx", "-g", "daemon off;"]
